function uploadVideo(){
    var me = this;
    wx.chooseVideo({
      sourceType: ['album'],
      success(res) {
        console.log(res)
        var duration = res.duration;
        var tempHeight = res.height;
        var tempWidth = res.width;
        var tmpVideoUrl = res.tempFilePath;
        var tmpCoverUrl= res.thumbTempFilePath;
  
        if (duration > 10){
          wx.showToast({
            title: '视频长度不能超过10秒',
            icon:"none",
            duration:2500
          })
        }else if(duration < 1){
          wx.showToast({
            title: '视频长度太短，请上传大于1秒的视频',
            icon:"none",
            duration:2500
          })
        }else{
          //页面跳转
          wx.navigateTo({
            url: '../chooseBgm/chooseBgm?duration=' + duration
            + "&tempHeight=" + tempHeight
            + "&tempWidth=" + tempWidth
            + "&tmpVideoUrl=" + tmpVideoUrl
            + "&tmpCoverUrl=" + tmpCoverUrl,
          })
        }
      }
    })
  }

module.exports = {
  uploadVideo: uploadVideo
}